<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>建发房产</title>
		<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="../css/font-awesome.min.css" />
		<link rel="stylesheet" type="text/css" href="../css/common.css" />
		<link rel="stylesheet" type="text/css" href="../css/billDetail.css" />
		<link rel="stylesheet" type="text/css" href="../css/month-picker.min.css" />
		<style type="text/css">
			.content img {
				width: 100px;
				height: 100px;
				position: absolute;
				top: 20%;
				left: 50%;
				margin-left: -50px;
				margin-top: -50px;
				display: none;
			}
			
			.content button {
				width: 200px;
				position: absolute;
				top: 40%;
				left: 50%;
				margin-left: -100px;
			}
		</style>
	</head>

	<body>
		<nav class="navbar navbar-default" role="navigation">
			<div class="container-fluid container">
				<div class="navbar-left logoImg">
					<!--<img src="../img/logo.png" />-->
				</div>
				<p class="navbar-text navbar-right shopAccount f16"><span class="accountName">商户账号</span>|<span class="quit">退出</span></p>
			</div>
		</nav>
		<div class="container content">
			<img id="successImg" src="../img/paySuccess.png" />
			<img id="failImg" src="../img/payFail.png" />
			<button class="btn btn-info btn-lg" id="btn">确定</button>
		</div>

		<!--<script src="../js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>-->
		<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
		<script src="../js/layer/layer.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/common.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/service.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(function() {
				var userInfo = '';

				function init() {
					userInfo = JSON.parse(decodeURI(decodeURI(sessionStorage.getItem('jf_user_info'))));
					var billNumber = sessionStorage.getItem('jf_billNumber');
					if(userInfo) {
						console.log(userInfo)
						$('.accountName').html(userInfo.name)
					} else {
						window.location.href = "../index.html";
					}
					getBillState(billNumber);
				}
				init();

				/**
				 * 根据账单号，查询该账单是否已经支付成功
				 * */
				function getBillState(billNumber) {
					function successFun(res) {
						if(res.data) {
							var state = res.data.state;
							if(state == "FINISH") {
								$('#successImg').show();
							} else {
								$('#failImg').show();
							}
						} else {
							$('#failImg').show();
						}
					}
					_http.queryStatus(billNumber, successFun);
				}
				//返回账单列表
				$('#btn').click(function() {
					window.location.href = "billList.html"
				})
			})
		</script>
	</body>

</html>